import 'package:flutter_deer/generated/json/base/json_field.dart';
import 'package:flutter_deer/generated/json/user_entity.g.dart';

@JsonSerializable()
class UserInfoEntity {

	UserInfoEntity();

	factory UserInfoEntity.fromJson(Map<String, dynamic> json) => $UserInfoEntityFromJson(json);

	Map<String, dynamic> toJson() => $UserInfoEntityToJson(this);

	@JSONField(name: 'sysUser')
	UserEntity? sysUser;
}

@JsonSerializable()
class UserAvatarEntity {

	UserAvatarEntity({this.username,this.avatar});

	factory UserAvatarEntity.fromJson(Map<String, dynamic> json) => $UserAvatarEntityFromJson(json);

	Map<String, dynamic> toJson() => $UserAvatarEntityToJson(this);

	@JSONField(name: 'avatar')
	String? avatar;
	@JSONField(name: 'username')
	String? username;
}

@JsonSerializable()
class UserEntity {

	UserEntity();

	factory UserEntity.fromJson(Map<String, dynamic> json) => $UserEntityFromJson(json);

	Map<String, dynamic> toJson() => $UserEntityToJson(this);

	@JSONField(name: 'avatar')
	String? avatar;
	@JSONField(name: 'username')
	String? username;
	@JSONField(name: 'accountId')
	String? accountId;
	@JSONField(name: 'shareCode')
	String? shareCode;
	@JSONField(name: 'phone')
	String? phone;
	@JSONField(name: 'perfect')
	String? perfect;
	@JSONField(name: 'nickname')
	String? nickname;
}

@JsonSerializable()
class UserPasswordLoginEntity {

	UserPasswordLoginEntity({this.username,this.password});

	factory UserPasswordLoginEntity.fromJson(Map<String, dynamic> json) => $UserPasswordLoginEntityFromJson(json);

	Map<String, dynamic> toJson() => $UserPasswordLoginEntityToJson(this);

	String? username;
	String? password;
}

@JsonSerializable()
class UserTokenEntity {

	UserTokenEntity({this.accessToken,this.refreshToken,this.tokenType,this.expiresIn,this.active,this.userId,this.username});

	factory UserTokenEntity.fromJson(Map<String, dynamic> json) => $UserTokenEntityFromJson(json);

	Map<String, dynamic> toJson() => $UserTokenEntityToJson(this);

	@JSONField(name: 'access_token')
	String? accessToken;
	@JSONField(name: 'refresh_token')
	String? refreshToken;
	@JSONField(name: 'token_type')
	String? tokenType;
	@JSONField(name: 'expires_in')
	int? expiresIn;
	bool? active;
	@JSONField(name: 'user_id')
	String? userId;
	String? username;
	String? perfect;

}
